Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecordBatch normalization (flattening) #6758

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ngli-me
Copy link
Contributor

@ngli-me ngli-me commented Nov 20, 2024

Which issue does this PR close?

Closes #6369.

Rationale for this change

Adds normalization (flattening) for RecordBatch, with normalization via Schema. Based on pandas/pola-rs.

What changes are included in this PR?

Are there any user-facing changes?

@ngli-me ngli-me changed the title Feature/record batch flatten RecordBatch normalization (flattening) Nov 20, 2024
@ngli-me ngli-me changed the title RecordBatch normalization (flattening) RecordBatch normalization (flattening) Nov 20, 2024
… iterative function for `RecordBatch`. Not sure which one is better currently.
@github-actions github-actions bot added the arrow Changes to the arrow crate label Nov 23, 2024
Copy link
Contributor Author

@ngli-me ngli-me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some questions regarding the implementation of this, since the one example from PyArrow doesn't seem to clarify on the edge cases here. Normalizing the Schema seems fairly straight forward to me, I'm just not sure on

  1. Whether the iterative or recursive approach is better (or something I missed)
  2. If DataType::Struct is the only DataType that requires flattening. To me, it looks like that's the only one that can contained nested Fields.

(I'm also not sure if I'm missing something with unwrapping like a List<Struct>)

Any feedback/help would be appreciated!

arrow-array/src/record_batch.rs Outdated Show resolved Hide resolved
arrow-array/src/record_batch.rs Outdated Show resolved Hide resolved
arrow-schema/src/schema.rs Show resolved Hide resolved
@ngli-me ngli-me marked this pull request as ready for review November 23, 2024 19:03
@ngli-me ngli-me marked this pull request as draft November 23, 2024 23:30
@ngli-me ngli-me marked this pull request as ready for review November 25, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support RecordBatch.flatten
1 participant